<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript">
	$(function() {
		var $grid = $('#set_position');
		var $baseUrl = 'sys/position';
		$grid.treegrid({
			border : false,
			singleSelect : false,
			url : $baseUrl + '/treeGrid?sort=sort,asc',
			onAjaxSuccess : function(data) {
				$(this).treegrid('unselectAll').treegrid('selectUrl', {
					url : '${param.action}/selected?joinIds=${param.id}'
				});
			},
			onBeforeSelect : function(row) {
				if (!$.fields.position.isPosition(row)) {
					return false;
				}
			},
			columns : [ [ $.fields.position.checkbox('positionIds', false), $.fields.treeField, $.fields.status ] ],
			toolbar : [ $.crudgrid.buttons.refresh, '-' ],
		}).treegrid('filter.init');
	});
</script>
<form action="${param.action}" method="post" class="easyui-panel" data-options="fit:true,border:false">
	<input name="id" value="${param.id}" type="hidden" />
	<table id="set_position" style="width: 100%, height:100%;"></table>
	<input type="hidden" name="_dontcare" value="_dontcare"/>
</form>
